|
|
|
|
|
|
|
The clearDataFields method clears each field on the form. Because it uses a text box collection to iterate through the fields, you can easily reuse this method (and the others) with essentially any form that displays data to users in text boxes. It can be easily customized to labels, grids, list boxes, and other data-aware controls. The methods prefixed with clicked refer to any clickable control that requires further processing. The method displayCurrentRecord displays the current record to the user. ProcessChangedField sets flags whenever the user changes the value of a field. This is helpful for edit/update operations. The methods processKeyDown, processKeyPress, and processLostFocus process the similarly named events in the form that relate to changing field values and updating resultsets (or recordsets). SetButtons enables and disables buttons on the form, based on how users interact with data-aware controls. SyncGrid synchronizes the contents of the MS Grid (or MS Flex Grid) control to keep its slave data in sync with the master record in the fields. Finally, setFieldVal handles the setting of each field on behalf of displayCurrentRecord. |
|
|
|
|
|
|
|
|
CommandBroker has the following members: |
|
|
|
|
|
|
|
|
Public Property Get CurrSQL() As String
Public Sub setTestSQL(argDataAccess As Byte) |
|
|
|
|
|
|
|
|
CurrSQL contains the current SQL statement. SetTestSQL is used to acquire dummy SQL commands by which to test the database subsystem. |
|
|
|
|
|
|
|
|
IDBSubsystem has the following members: |
|
|
|
|
|
|
|
|
Public Property Get DBConnection() As Object
Public Property Get DBResultset() As Object
Public Sub initializeDB(Optional argDataAccess As Byte)
Private Sub setAdo(argDataAccess As Byte)
Private Sub setDao(argDataAccess As Byte)
Private Sub setRdo(argDataAccess As Byte)
Public Sub setDataControl(argDataControl As Object) |
|
|
|
|
|
|
|
|
DBConnection is a generic object reference that can be adapted to the connection classes for Ado, Rdo, and Dao. DBResultset plays the same adapter role for the resultset classes of Ado, Rdo, and Dao. InitializeDB initializes the database environment for the entire application. The argument argDataAccess is a value that specifies which data access mechanism (eDataAccess enum value for Ado, Rdo, and Dao) to use. |
|
|
|
|
|
|
|
|
DefaultDriverName and DefaultServerName are used to specify the default driver name of the ODBC driver and the default server name of the database server. These are helpful when doing connections that don't require a data source name (DSN) as part of the connection string. The methods setAdo, setRdo, and setDao establish which data access mechanism (specified by the argDataAccess argument of initializeDB to use. Finally, the setDataControl method accepts an argument, argDataControl, that is a reference to a Data control to be synchronized in CDatabaseForm's syncGrid method. |
|
|
|
|
|